/*
 * @Author: Yzq
 * @Date: 2021-03-31 11:14:21
 * @LastEditTime: 2021-04-06 18:25:13
 * @LastEditors: Yzq
 */
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * Generated with the TypeScript template
 * https://github.com/react-native-community/react-native-template-typescript
 *
 * @format
 */

import React from 'react';
import {View} from 'react-native';
import AppStack from './pages/navigator';
import User from './pages/Dao/user';

class App extends React.Component {
  constructor(props: any) {
    super(props);
  }

  state = {
    isReady: false,
  };
  componentDidMount() {
    //TODO:改为初始化token
    User.init().finally(() => {
      this.setState({
        isReady: true,
      });
    });
  }

  render() {
    return (
      <View style={{flex: 1}}>{this.state.isReady ? <AppStack /> : null}</View>
    );
  }
}

export default App;
